<?php  if (!defined('insite')) die();
class content
{
 /**
 *constatns
 **/
 var $vars = array();
 var $content = '';

 public function set($name, $val) 
 {
  $this->vars[$name] = $val;
 }

 function out_content($tpl) 
 {
  $this->content = @file_get_contents($tpl);
  if ($this->content == false)
  {
   $this->if_error($tpl);
   $this->destr();
  }
  else
  {
    foreach($this->vars as $key => $val)
    {
    $this->content = str_replace($key, $val, $this->content);
    }
    echo $this->content;
  }
 }
 function destr()
 {
	unset($this->content);
 }

 function if_error($filename)
 {
  echo "<div align='center' style='color:red;font-weight:bold;'>files in $filename not found! </div>";
 }
}
//$content = new content();